home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / alangsbs.zip / EAT4.ASM < prev    next >
Assembly Source File  |  1989-12-27  |  3KB  |  90 lines

  1. ;---------------------------------------------------------------
  2. ;                             EAT4.ASM
  3. ;    Backhanded advertising program, with external references
  4. ;
  5. ;                                      by Jeff Duntemann
  6. ;                                      MASM/TASM
  7. ;                                      Last update 12/27/89
  8. ;---------------------------------------------------------------
  9.  
  10. ;----------------------------|
  11. ;    BEGIN STACK SEGMENT     |
  12. ;----------------------------|
  13. MYSTACK    SEGMENT STACK        ; STACK word ensures loading of SS by DOS
  14.  
  15.            DB      64 DUP ('STACK!!!') ; This reserves 512 bytes for the stack
  16.  
  17. MYSTACK    ENDS
  18. ;----------------------------|
  19. ;     END STACK SEGMENT      |
  20. ;----------------------------|
  21.  
  22.  
  23. ;----------------------------|
  24. ;     BEGIN DATA SEGMENT     |
  25. ;----------------------------|
  26. MyData     SEGMENT PUBLIC
  27.            PUBLIC LRXY,CRLF
  28.  
  29. LRXY       DW      184FH ; 18H = 24D; 4FH = 79D; 0-based XY of LR screen corner
  30.  
  31.  
  32. TextPos    DW      ?
  33. Eat1       DB      "Eat at Joe's...",'$'
  34. Eat2       DB      "...ten million flies can't ALL be wrong!",'$'
  35. CRLF       DB      0DH,0AH,'$'
  36.  
  37. MyData     ENDS
  38. ;----------------------------|
  39. ;      END DATA SEGMENT      |
  40. ;----------------------------|
  41.  
  42. ;----------------------------|
  43. ;     BEGIN CODE SEGMENT     |
  44. ;----------------------------|
  45.  
  46. ; Note that the following items are external to EAT4.ASM, and must
  47. ;   be linked from the external file VIDLIB.OBJ.  Assemble VIDLIB.ASM
  48. ;   first to VIDLIB.OBJ before attempting the link.
  49.  
  50.            EXTRN GotoXY:PROC,Write:PROC,Writeln:PROC,ClrScr:PROC
  51.  
  52. MyCode     SEGMENT PUBLIC
  53.  
  54.  
  55.            assume CS:MyCode,DS:MyData
  56. Main       PROC
  57.  
  58. Start:     ; This is where program execution begins:
  59.            mov  AX,MyData   ; Set up our own data segment address in DS
  60.            mov  DS,AX       ; Can't load segment reg. directly from memory
  61.  
  62.            call ClrScr      ; Clear the full display
  63.  
  64.            mov  TextPos, 0914H   ; 0914H = X @ 20, Y @ 9
  65.  
  66.            mov  DX,TextPos  ; TextPos contains X,Y position values
  67.            call GotoXY      ; Position cursor
  68.            lea  DX,Eat1     ; Load offset of Eat1 string into DX
  69.            call Write       ;   and display it
  70.  
  71.            mov  DX,TextPos  ; Re-use text position variable
  72.            mov  DH,10       ; Put new Y value into DH
  73.            call GotoXY      ; Position cursor
  74.            lea  DX,Eat2     ; Load offset of Ear2 string into DX
  75.            call Writeln     ;   and display it
  76.  
  77.            mov  AH,4CH      ; Terminate process DOS service
  78.            mov  AL,0        ; Pass this value back to ERRORLEVEL
  79.            int  21H         ; Control returns to DOS
  80.  
  81. Main       ENDP
  82.  
  83. MyCode     ENDS
  84.  
  85. ;----------------------------|
  86. ;      END CODE SEGMENT      |
  87. ;----------------------------|
  88.  
  89.            END Start    ; The procedure named Start becomes the main program
  90.